<?php defined('IN_LK') or die('Access Denied');
lk::lo_app('index_common', 'index', 0);
/**
 * 内容页
 */
class show extends index_common
{
	private $content_db;
	
	public function __construct()
	{
		parent::__construct();
		$this->content_db = lk::load_model('content');
	}
	
	public function initialize()
	{
		if(!isset($_GET['id']) && !$_GET['id'])
		{
			showmsg(LANG('parameters_error'), false);
		}
		$id = (int)$_GET['id'];
		$res = $this->content_db->is_exists($id);
		if(!$res)
		{
			include template('show_no');
			exit();
		}
		$objecttype = $this->content_db->objs;
		$pxfs = $this->content_db->pxfs;
		$res['object'] = $res['objecttype'] ? $objecttype[$res['objecttype']] : '无';
		$res['pxfs']   = $res['pxfangshi'] ? $pxfs[$res['pxfangshi']] : '';
		eval("\$info=" . $res['info'] . ";");
		$man  = isset($info['man']) ? $info['man'] : '';
		$email= isset($info['email']) ? $info['email'] : '';
		$tel  = $info['tel'];
		$addr = $info['addr'];
		$res['updatetime'] = date('Y-m-d', $res['updatetime']);
		$res['content'] = nl2br($res['content']);
		$this->content_db->hits_count($res['id']);
		parent::add_views($id);
		include template('show');
	}
	
}